package com.easylinkin.linkappapi.roster.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.easylinkin.linkappapi.roster.entity.RailLinkappRosterPersonnel;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface RailLinkappRosterPersonnelMapper extends BaseMapper<RailLinkappRosterPersonnel> {
    @Select("SELECT COUNT(1) FROM rail_linkapp_roster_personnel WHERE labor_team = #{laborTeamId}")
    int countByLaborTeam(@Param("laborTeamId") Long laborTeamId);


    @Select("SELECT a.* FROM rail_linkapp_roster_personnel a WHERE a.tenant_id=#{tenantId} and a.roster_post=#{rosterPost}  ORDER BY a.create_time DESC LIMIT 1")
    RailLinkappRosterPersonnel selectByPostOne(@Param("tenantId") String tenantId,@Param("rosterPost") String rosterPost);
} 